<?php
/**
 * @desc :Created by PhpStorm.
 * @author : Baoshi <120907037@qq.com>
 * @since: 2018/7/24 19:52
 */
namespace app\common\designpattern\push;
use util\Jpush as JiguangPush;

/**
 * 极光推送
 */
class JPush implements PushInterface {

	/**
     * 根据别名推送通知信息
     * alias 设备别名
     * title 推送标题
     * content 推送内容
     */
    public function setPushByAlias($alias, $title, $content){
        $push = new JiguangPush();
        $push_result = $push -> push($alias, $title, $content);
        if($push_result['code'] == 200){
            return array_out(200, 'success', $push_result['data']);
        }else{
            return array_out(-1001, 'error');
        }
    }


}